<template>
  <div class="demo">
    <h1>Props配置案例，{{msg}}</h1>
    <h2>{{name}}</h2>
    <h2>{{age}}</h2>
    <hr>
  </div>
</template>

<script>
export default {
  name: 'PropsView',
  data() {
    return {
      msg: '学生如下：'
    }
  },
  // props: ['name', 'age']
  // props: {
  //   name: String,
  //   age: Number,
  // }

  props: {
    name: {
      type: String,
      required: true,
    },
    age: {
      type: Number,
      default: 99,
    }
  }
}
</script>

<style scoped>
  .demo {
    background: orange;
  }
</style>